package b2.config
{
	public class CommonObjConfig
	{
		//石油
		public static const OIL:int = 0;
		//天然气
		public static const GAS:int = 1;
		//经验
		public static const EXP:int = 2;
		//荣誉
		public static const HONOUR:int = 3;
		//催化剂
		public static const ACT:int = 4;
		//战力
		public static const FIGHT_POINT:int = 9;
		//荣誉勋章
		public static const HONOUR_MEDAL:int = 10;
		//英雄之证
		public static const HERO_VERT:int = 11;
		
		//类别：0, 坦克; 1, 装备; 2, 物品; 
		public var type:int;
		//价格（石油)
		public var priceOil:int;
		//价格（天然气)
		public var priceGas:int;
		//价格（荣誉勋章）
		public var priceHonour:int;
		//所有物品的唯一索引
		public var index:int;
		//物品名字
		public var name:String;
		//描述文字
		public var description:String;
		//没有强化分级（星级）
		public var noStrengthenLevel:Boolean;
		//没有基础分级（品质）
		public var noBasicLevel:Boolean;
		//需要等级 
		public var requireLevel:int;
		//是否在商店中显示
		public var showInStore:Boolean;
		//是否出售
		public var onSaleFlag:Boolean;
		//物品图片
		public var iconImage:String;
		//强化升级消耗的材料种类
		public var materialIndex:Array;
		//强化升级消耗的材料个数
		public var materialNum:Array;
		//强化成功率
		public var successRate:Array;
		
		public function CommonObjConfig(objectXML:XML)
		{
			type = objectXML.type;
			index = objectXML.index;
			name = objectXML.name;
			description = objectXML.description;
			noStrengthenLevel = Boolean(parseInt(objectXML.noStrengthenLevel));
			noBasicLevel = Boolean(parseInt(objectXML.noBasicLevel));
			priceOil = objectXML.priceOil;
			priceGas = objectXML.priceGas;
			priceHonour = objectXML.priceHonour;
			requireLevel = objectXML.requireLevel;
			showInStore = Boolean(parseInt(objectXML.showInStore));
			onSaleFlag = Boolean(parseInt(objectXML.onSaleFlag));
			iconImage = objectXML.iconImage;
			if (objectXML.materialIndex != undefined)
				this.materialIndex = objectXML.materialIndex.split(",");
			materialNum = new Array();
			for (var i:int = 0; i < objectXML.materialNum.length(); i++)
			{
				materialNum.push(objectXML.materialNum[i].split(","));
			}
			if (objectXML.successRate != undefined)
			{
				this.successRate = objectXML.successRate.split(",");
			}
		}

	}
}